package com.chenjinyan.lostandfindribbon;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class UserService {

    @Autowired
    RestTemplate restTemplate;

    @HystrixCommand
    public String user(String loginAccount) {
        return restTemplate.getForEntity("http://LOST-AND-FIND-USER/user/signloginacc/{loginAccount}", String.class, loginAccount).getBody();
    }

}
